using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VAMMELD
    {
        public DataRow Convert2AMMELD(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryAMMELD(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
         dwReturn["AMDMANDANT"] = " ".PadRight(2 ); 
         dwReturn["AMDMNRKRS"] = " ".PadRight(2 ); 
         dwReturn["AMDMLFDNR"] = " ".PadRight(4 ); 
         dwReturn["AMDMPOS"] = " ".PadRight(2 ); 
         dwReturn["AMDLFDPOS"] = " ".PadRight(0 ); 
         dwReturn["AMDSSDAT"] = " ".PadRight(0 ); 
         dwReturn["AMDSCHICHT"] = " ".PadRight(1 ); 
         dwReturn["AMDSDAT"] = " ".PadRight(0 ); 
         dwReturn["AMDSZT"] = " ".PadRight(0 ); 
         dwReturn["AMDEDAT"] = " ".PadRight(0 ); 
         dwReturn["AMDEZT"] = " ".PadRight(0 ); 
         dwReturn["AMDSEK"] = " ".PadRight(0 ); 
         dwReturn["AMDLEDAT"] = " ".PadRight(0 ); 
         dwReturn["AMDLEZT"] = " ".PadRight(0 ); 
         dwReturn["AMDSEKG"] = " ".PadRight(0 ); 
         dwReturn["AMDOKZ"] = " ".PadRight(1 ); 
         dwReturn["AMDZKZ"] = " ".PadRight(1 ); 
         dwReturn["AMDVKZ"] = " ".PadRight(1 ); 
         dwReturn["AMDMCODE"] = " ".PadRight(3 ); 
         dwReturn["AMDTAT"] = " ".PadRight(5 ); 
         dwReturn["AMDPROG"] = " ".PadRight(8 ); 
         dwReturn["AMDRLFDPOS"] = " ".PadRight(0 ); 
         dwReturn["AMDPERSNR"] = " ".PadRight(8 ); 
         dwReturn["AMDAUFKRS"] = " ".PadRight(2 ); 
         dwReturn["AMDAUFLFD"] = " ".PadRight(6 ); 
         dwReturn["AMDAUFPOS"] = " ".PadRight(3 ); 
         dwReturn["AMDAFOLGE"] = " ".PadRight(3 ); 
         dwReturn["AMDTP"] = " ".PadRight(4 ); 
         dwReturn["AMDSTKNR"] = " ".PadRight(12 ); 
         dwReturn["AMDKSLPOS"] = " ".PadRight(0 ); 
         dwReturn["AMDAUFART"] = " ".PadRight(2 ); 
         dwReturn["AMDMG"] = " ".PadRight(0 ); 
         dwReturn["AMDSCHUSS"] = " ".PadRight(0 ); 
         dwReturn["AMDSLFZT"] = " ".PadRight(0 ); 
         dwReturn["AMDSSTZT"] = " ".PadRight(0 ); 
         dwReturn["AMDSRUESTZT"] = " ".PadRight(0 ); 
         dwReturn["AMDSPERSFZT"] = " ".PadRight(0 ); 
         dwReturn["AMDSPERSRZT"] = " ".PadRight(0 ); 
         dwReturn["AMDILFZT"] = " ".PadRight(0 ); 
         dwReturn["AMDISTZT"] = " ".PadRight(0 ); 
         dwReturn["AMDIRUESTZT"] = " ".PadRight(0 ); 
         dwReturn["AMDIAFZT"] = " ".PadRight(0 ); 
         dwReturn["AMDIPERSFZT"] = " ".PadRight(0 ); 
         dwReturn["AMDIPERSRZT"] = " ".PadRight(0 ); 
         dwReturn["AMDBRAZT"] = " ".PadRight(0 ); 
         dwReturn["AMDFMG1"] = " ".PadRight(0 ); 
         dwReturn["AMDFMG2"] = " ".PadRight(0 ); 
         dwReturn["AMDFMG3"] = " ".PadRight(0 ); 
         dwReturn["AMDFMG4"] = " ".PadRight(0 ); 
         dwReturn["AMDELMTR"] = " ".PadRight(0 ); 
         dwReturn["AMDVMUKZ"] = " ".PadRight(1 ); 
         dwReturn["AMDNSKZ"] = " ".PadRight(1 ); 
         dwReturn["AMDZWPKZ"] = " ".PadRight(1 ); 
         dwReturn["AMDLFMAZL"] = " ".PadRight(0 ); 
         dwReturn["AMDLFMEZL"] = " ".PadRight(0 ); 
         dwReturn["AMDLFZAZL"] = " ".PadRight(0 ); 
         dwReturn["AMDLFZEZL"] = " ".PadRight(0 ); 
         dwReturn["AMDBAUMKRS"] = " ".PadRight(2 ); 
         dwReturn["AMDBAUMLFD"] = " ".PadRight(6 ); 
         dwReturn["AMDMLFDPOS"] = " ".PadRight(0 ); 
         dwReturn["AMDEKZ"] = " ".PadRight(1 ); 
         dwReturn["AMDSOFKT"] = " ".PadRight(2 ); 
         dwReturn["AMDKENNUNG"] = " ".PadRight(2 ); 
         dwReturn["AMDGEBNR"] = " ".PadRight(8 ); 
         dwReturn["AMDKUNDNR"] = " ".PadRight(8 ); 
         dwReturn["AMDLAGE"] = " ".PadRight(2 ); 
         dwReturn["AMDERSATZ"] = " ".PadRight(1 ); 
         dwReturn["AMDADDON"] = " ".PadRight(20 ); 
         dwReturn["AMDCOUNTER"] = " ".PadRight(0 ); 
         dwReturn["AMDCOMFLG"] = " ".PadRight(1 ); 
         dwReturn["AMDFILLER"] = " ".PadRight(76 ); 
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapAMMELD(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveAMMELD(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryAMMELD(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapAMMELD(ref dwLocal, dwData);

            if (!flgExist)
            {

                InsertAMMELD(dwLocal, ITXDBVERSION);
            }
            UpdateAMMELD(dwLocal);
        }
        public void InsertAMMELD(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                    or1.CommandText = "INSERT INTO AMMELD(VAKBMANDANT, VAKBKOLL, VAKBART, VAKBKUNDNR, VAKBFARBE, VAKBKDARTNR, VAKBKDARTBEZ, VAKBKDFARBNR, VAKBANDRUCK, VAKBMEGEW, VAKBMENGEH, VAKBGEWVON, VAKBGEWBIS, VAKBGEWCA, VAKBGEWFKT, VAKBGEWGRP, VAKBMEGFKT, VAKBMEGGRP, VAKBAENDZL, VAKBAENDBEN, VAKBAENDDAT, VAKBNEUBEN, VAKBNEUDAT, VAKBFILLER)"
                        + " VALUES (:VAKBMANDANT, :VAKBKOLL, :VAKBART, :VAKBKUNDNR, :VAKBFARBE, '                         ', '                         ', '                             ', ' ', '   ', '   ', 0, 0, ' ', '000000000000', ' ', '000000000000', ' ', 0, '        ', '000000', '        ', '      ', '                                          ')";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }
            
            Connect2Proxy(or1);
        }
        public DataSet QueryAMMELD(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM AMMELD WHERE  ROWNUM<2 ";
                    break;
              
                case 99:
                    or1.CommandText = "SELECT * FROM AMMELD  WHERE ROWNUM<50";
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "AMMELD";
            Return = Result;
            return Return;
        }
        public void DeleteAMMELD(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM AMMELD   WHERE  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                     or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        } 
      
        public void UpdateAMMELD(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region====Command==== 
                    or1.CommandText = "UPDATE AMMELD SET "
                    +"AMDMANDANT= :AMDMANDANT,"
                    +"AMDMNRKRS= :AMDMNRKRS,"
                    +"AMDMLFDNR= :AMDMLFDNR,"
                    +"AMDMPOS= :AMDMPOS,"
                    +"AMDLFDPOS= :AMDLFDPOS,"
                    +"AMDSSDAT= :AMDSSDAT,"
                    +"AMDSCHICHT= :AMDSCHICHT,"
                    +"AMDSDAT= :AMDSDAT,"
                    +"AMDSZT= :AMDSZT,"
                    +"AMDEDAT= :AMDEDAT,"
                    +"AMDEZT= :AMDEZT,"
                    +"AMDSEK= :AMDSEK,"
                    +"AMDLEDAT= :AMDLEDAT,"
                    +"AMDLEZT= :AMDLEZT,"
                    +"AMDSEKG= :AMDSEKG,"
                    +"AMDOKZ= :AMDOKZ,"
                    +"AMDZKZ= :AMDZKZ,"
                    +"AMDVKZ= :AMDVKZ,"
                    +"AMDMCODE= :AMDMCODE,"
                    +"AMDTAT= :AMDTAT,"
                    +"AMDPROG= :AMDPROG,"
                    +"AMDRLFDPOS= :AMDRLFDPOS,"
                    +"AMDPERSNR= :AMDPERSNR,"
                    +"AMDAUFKRS= :AMDAUFKRS,"
                    +"AMDAUFLFD= :AMDAUFLFD,"
                    +"AMDAUFPOS= :AMDAUFPOS,"
                    +"AMDAFOLGE= :AMDAFOLGE,"
                    +"AMDTP= :AMDTP,"
                    +"AMDSTKNR= :AMDSTKNR,"
                    +"AMDKSLPOS= :AMDKSLPOS,"
                    +"AMDAUFART= :AMDAUFART,"
                    +"AMDMG= :AMDMG,"
                    +"AMDSCHUSS= :AMDSCHUSS,"
                    +"AMDSLFZT= :AMDSLFZT,"
                    +"AMDSSTZT= :AMDSSTZT,"
                    +"AMDSRUESTZT= :AMDSRUESTZT,"
                    +"AMDSPERSFZT= :AMDSPERSFZT,"
                    +"AMDSPERSRZT= :AMDSPERSRZT,"
                    +"AMDILFZT= :AMDILFZT,"
                    +"AMDISTZT= :AMDISTZT,"
                    +"AMDIRUESTZT= :AMDIRUESTZT,"
                    +"AMDIAFZT= :AMDIAFZT,"
                    +"AMDIPERSFZT= :AMDIPERSFZT,"
                    +"AMDIPERSRZT= :AMDIPERSRZT,"
                    +"AMDBRAZT= :AMDBRAZT,"
                    +"AMDFMG1= :AMDFMG1,"
                    +"AMDFMG2= :AMDFMG2,"
                    +"AMDFMG3= :AMDFMG3,"
                    +"AMDFMG4= :AMDFMG4,"
                    +"AMDELMTR= :AMDELMTR,"
                    +"AMDVMUKZ= :AMDVMUKZ,"
                    +"AMDNSKZ= :AMDNSKZ,"
                    +"AMDZWPKZ= :AMDZWPKZ,"
                    +"AMDLFMAZL= :AMDLFMAZL,"
                    +"AMDLFMEZL= :AMDLFMEZL,"
                    +"AMDLFZAZL= :AMDLFZAZL,"
                    +"AMDLFZEZL= :AMDLFZEZL,"
                    +"AMDBAUMKRS= :AMDBAUMKRS,"
                    +"AMDBAUMLFD= :AMDBAUMLFD,"
                    +"AMDMLFDPOS= :AMDMLFDPOS,"
                    +"AMDEKZ= :AMDEKZ,"
                    +"AMDSOFKT= :AMDSOFKT,"
                    +"AMDKENNUNG= :AMDKENNUNG,"
                    +"AMDGEBNR= :AMDGEBNR,"
                    +"AMDKUNDNR= :AMDKUNDNR,"
                    +"AMDLAGE= :AMDLAGE,"
                    +"AMDERSATZ= :AMDERSATZ,"
                    +"AMDADDON= :AMDADDON,"
                    +"AMDCOUNTER= :AMDCOUNTER,"
                    +"AMDCOMFLG= :AMDCOMFLG,"
                    +"AMDFILLER= :AMDFILLER,"
                        + " WHERE  "
                        + "  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    #endregion

                    #region====Parameters====
          or1.Parameters.Add("AMDMANDANT", OracleType.NVarChar).Value = dwData["AMDMANDANT"].ToString(); 
          or1.Parameters.Add("AMDMNRKRS", OracleType.NVarChar).Value = dwData["AMDMNRKRS"].ToString(); 
          or1.Parameters.Add("AMDMLFDNR", OracleType.NVarChar).Value = dwData["AMDMLFDNR"].ToString(); 
          or1.Parameters.Add("AMDMPOS", OracleType.NVarChar).Value = dwData["AMDMPOS"].ToString(); 
          or1.Parameters.Add("AMDLFDPOS", OracleType.NVarChar).Value = dwData["AMDLFDPOS"].ToString(); 
          or1.Parameters.Add("AMDSSDAT", OracleType.NVarChar).Value = dwData["AMDSSDAT"].ToString(); 
          or1.Parameters.Add("AMDSCHICHT", OracleType.NVarChar).Value = dwData["AMDSCHICHT"].ToString(); 
          or1.Parameters.Add("AMDSDAT", OracleType.NVarChar).Value = dwData["AMDSDAT"].ToString(); 
          or1.Parameters.Add("AMDSZT", OracleType.NVarChar).Value = dwData["AMDSZT"].ToString(); 
          or1.Parameters.Add("AMDEDAT", OracleType.NVarChar).Value = dwData["AMDEDAT"].ToString(); 
          or1.Parameters.Add("AMDEZT", OracleType.NVarChar).Value = dwData["AMDEZT"].ToString(); 
          or1.Parameters.Add("AMDSEK", OracleType.NVarChar).Value = dwData["AMDSEK"].ToString(); 
          or1.Parameters.Add("AMDLEDAT", OracleType.NVarChar).Value = dwData["AMDLEDAT"].ToString(); 
          or1.Parameters.Add("AMDLEZT", OracleType.NVarChar).Value = dwData["AMDLEZT"].ToString(); 
          or1.Parameters.Add("AMDSEKG", OracleType.NVarChar).Value = dwData["AMDSEKG"].ToString(); 
          or1.Parameters.Add("AMDOKZ", OracleType.NVarChar).Value = dwData["AMDOKZ"].ToString(); 
          or1.Parameters.Add("AMDZKZ", OracleType.NVarChar).Value = dwData["AMDZKZ"].ToString(); 
          or1.Parameters.Add("AMDVKZ", OracleType.NVarChar).Value = dwData["AMDVKZ"].ToString(); 
          or1.Parameters.Add("AMDMCODE", OracleType.NVarChar).Value = dwData["AMDMCODE"].ToString(); 
          or1.Parameters.Add("AMDTAT", OracleType.NVarChar).Value = dwData["AMDTAT"].ToString(); 
          or1.Parameters.Add("AMDPROG", OracleType.NVarChar).Value = dwData["AMDPROG"].ToString(); 
          or1.Parameters.Add("AMDRLFDPOS", OracleType.NVarChar).Value = dwData["AMDRLFDPOS"].ToString(); 
          or1.Parameters.Add("AMDPERSNR", OracleType.NVarChar).Value = dwData["AMDPERSNR"].ToString(); 
          or1.Parameters.Add("AMDAUFKRS", OracleType.NVarChar).Value = dwData["AMDAUFKRS"].ToString(); 
          or1.Parameters.Add("AMDAUFLFD", OracleType.NVarChar).Value = dwData["AMDAUFLFD"].ToString(); 
          or1.Parameters.Add("AMDAUFPOS", OracleType.NVarChar).Value = dwData["AMDAUFPOS"].ToString(); 
          or1.Parameters.Add("AMDAFOLGE", OracleType.NVarChar).Value = dwData["AMDAFOLGE"].ToString(); 
          or1.Parameters.Add("AMDTP", OracleType.NVarChar).Value = dwData["AMDTP"].ToString(); 
          or1.Parameters.Add("AMDSTKNR", OracleType.NVarChar).Value = dwData["AMDSTKNR"].ToString(); 
          or1.Parameters.Add("AMDKSLPOS", OracleType.NVarChar).Value = dwData["AMDKSLPOS"].ToString(); 
          or1.Parameters.Add("AMDAUFART", OracleType.NVarChar).Value = dwData["AMDAUFART"].ToString(); 
          or1.Parameters.Add("AMDMG", OracleType.NVarChar).Value = dwData["AMDMG"].ToString(); 
          or1.Parameters.Add("AMDSCHUSS", OracleType.NVarChar).Value = dwData["AMDSCHUSS"].ToString(); 
          or1.Parameters.Add("AMDSLFZT", OracleType.NVarChar).Value = dwData["AMDSLFZT"].ToString(); 
          or1.Parameters.Add("AMDSSTZT", OracleType.NVarChar).Value = dwData["AMDSSTZT"].ToString(); 
          or1.Parameters.Add("AMDSRUESTZT", OracleType.NVarChar).Value = dwData["AMDSRUESTZT"].ToString(); 
          or1.Parameters.Add("AMDSPERSFZT", OracleType.NVarChar).Value = dwData["AMDSPERSFZT"].ToString(); 
          or1.Parameters.Add("AMDSPERSRZT", OracleType.NVarChar).Value = dwData["AMDSPERSRZT"].ToString(); 
          or1.Parameters.Add("AMDILFZT", OracleType.NVarChar).Value = dwData["AMDILFZT"].ToString(); 
          or1.Parameters.Add("AMDISTZT", OracleType.NVarChar).Value = dwData["AMDISTZT"].ToString(); 
          or1.Parameters.Add("AMDIRUESTZT", OracleType.NVarChar).Value = dwData["AMDIRUESTZT"].ToString(); 
          or1.Parameters.Add("AMDIAFZT", OracleType.NVarChar).Value = dwData["AMDIAFZT"].ToString(); 
          or1.Parameters.Add("AMDIPERSFZT", OracleType.NVarChar).Value = dwData["AMDIPERSFZT"].ToString(); 
          or1.Parameters.Add("AMDIPERSRZT", OracleType.NVarChar).Value = dwData["AMDIPERSRZT"].ToString(); 
          or1.Parameters.Add("AMDBRAZT", OracleType.NVarChar).Value = dwData["AMDBRAZT"].ToString(); 
          or1.Parameters.Add("AMDFMG1", OracleType.NVarChar).Value = dwData["AMDFMG1"].ToString(); 
          or1.Parameters.Add("AMDFMG2", OracleType.NVarChar).Value = dwData["AMDFMG2"].ToString(); 
          or1.Parameters.Add("AMDFMG3", OracleType.NVarChar).Value = dwData["AMDFMG3"].ToString(); 
          or1.Parameters.Add("AMDFMG4", OracleType.NVarChar).Value = dwData["AMDFMG4"].ToString(); 
          or1.Parameters.Add("AMDELMTR", OracleType.NVarChar).Value = dwData["AMDELMTR"].ToString(); 
          or1.Parameters.Add("AMDVMUKZ", OracleType.NVarChar).Value = dwData["AMDVMUKZ"].ToString(); 
          or1.Parameters.Add("AMDNSKZ", OracleType.NVarChar).Value = dwData["AMDNSKZ"].ToString(); 
          or1.Parameters.Add("AMDZWPKZ", OracleType.NVarChar).Value = dwData["AMDZWPKZ"].ToString(); 
          or1.Parameters.Add("AMDLFMAZL", OracleType.NVarChar).Value = dwData["AMDLFMAZL"].ToString(); 
          or1.Parameters.Add("AMDLFMEZL", OracleType.NVarChar).Value = dwData["AMDLFMEZL"].ToString(); 
          or1.Parameters.Add("AMDLFZAZL", OracleType.NVarChar).Value = dwData["AMDLFZAZL"].ToString(); 
          or1.Parameters.Add("AMDLFZEZL", OracleType.NVarChar).Value = dwData["AMDLFZEZL"].ToString(); 
          or1.Parameters.Add("AMDBAUMKRS", OracleType.NVarChar).Value = dwData["AMDBAUMKRS"].ToString(); 
          or1.Parameters.Add("AMDBAUMLFD", OracleType.NVarChar).Value = dwData["AMDBAUMLFD"].ToString(); 
          or1.Parameters.Add("AMDMLFDPOS", OracleType.NVarChar).Value = dwData["AMDMLFDPOS"].ToString(); 
          or1.Parameters.Add("AMDEKZ", OracleType.NVarChar).Value = dwData["AMDEKZ"].ToString(); 
          or1.Parameters.Add("AMDSOFKT", OracleType.NVarChar).Value = dwData["AMDSOFKT"].ToString(); 
          or1.Parameters.Add("AMDKENNUNG", OracleType.NVarChar).Value = dwData["AMDKENNUNG"].ToString(); 
          or1.Parameters.Add("AMDGEBNR", OracleType.NVarChar).Value = dwData["AMDGEBNR"].ToString(); 
          or1.Parameters.Add("AMDKUNDNR", OracleType.NVarChar).Value = dwData["AMDKUNDNR"].ToString(); 
          or1.Parameters.Add("AMDLAGE", OracleType.NVarChar).Value = dwData["AMDLAGE"].ToString(); 
          or1.Parameters.Add("AMDERSATZ", OracleType.NVarChar).Value = dwData["AMDERSATZ"].ToString(); 
          or1.Parameters.Add("AMDADDON", OracleType.NVarChar).Value = dwData["AMDADDON"].ToString(); 
          or1.Parameters.Add("AMDCOUNTER", OracleType.NVarChar).Value = dwData["AMDCOUNTER"].ToString(); 
          or1.Parameters.Add("AMDCOMFLG", OracleType.NVarChar).Value = dwData["AMDCOMFLG"].ToString(); 
          or1.Parameters.Add("AMDFILLER", OracleType.NVarChar).Value = dwData["AMDFILLER"].ToString(); 
                    #endregion
                    break; 
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
    }
}
